﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.customer.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.customer.dao.*;
import com.hh.bss.customer.entity.*;
import com.hh.bss.customer.service.*;
import com.hh.bss.customer.vo.query.*;
import com.hh.bss.util.*;





public class CustomerContract extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CustomerContract";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_CUST_ID = "custId";
	public static final String ALIAS_CONTRACT_STYLE = "contractStyle";
	public static final String ALIAS_CONTRACT_TYPE = "contractType";
	public static final String ALIAS_LANG = "lang";
	public static final String ALIAS_AR_RATE = "arRate";
	public static final String ALIAS_MIN_AR = "minAr";
	public static final String ALIAS_BEGIN_D = "beginD";
	public static final String ALIAS_END_D = "endD";
	public static final String ALIAS_AR_D = "arD";
	public static final String ALIAS_PRE_AR = "preAr";
	public static final String ALIAS_PRE_AR_D = "preArD";
	public static final String ALIAS_PRE_UNIT = "preUnit";
	public static final String ALIAS_TRIAL_MONTHS = "trialMonths";
	public static final String ALIAS_REFUND_RATE = "refundRate";
	public static final String ALIAS_DELAY_RATE = "delayRate";
	public static final String ALIAS_SEARCH_LIMIT = "searchLimit";
	public static final String ALIAS_COMMENT = "comment";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	
	//date formats
	public static final String FORMAT_BEGIN_D = DATE_FORMAT;
	public static final String FORMAT_END_D = DATE_FORMAT;
	public static final String FORMAT_AR_D = DATE_FORMAT;
	public static final String FORMAT_PRE_AR_D = DATE_FORMAT;
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer custId;
	@NotBlank @Length(max=20)
	private java.lang.String contractStyle;
	@NotNull 
	private java.lang.Integer contractType;
	@NotBlank @Length(max=20)
	private java.lang.String lang;
	@NotNull 
	private String arRate;
	@NotNull 
	private java.lang.Double minAr;
	@NotNull 
	private java.util.Date beginD;
	@NotNull 
	private java.util.Date endD;
	
	private Integer arD;
	
	private java.lang.Double preAr;
	
	private java.util.Date preArD;
	@Length(max=20)
	private java.lang.String preUnit;
	
	@Length(max=20)
	private String trialMonths;
	
	private java.lang.Double refundRate;
	
	private java.lang.Double delayRate;
	@Length(max=255)
	private java.lang.String searchLimit;
	@Length(max=255)
	private java.lang.String comment;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	//columns END
	private String nbr;
	private String title;
	private String custName;


	public String getCustName() {
		return custName;
	}

	public void setCustName(String custName) {
		this.custName = custName;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getNbr() {
		return nbr;
	}

	public void setNbr(String nbr) {
		this.nbr = nbr;
	}

	public CustomerContract(){
	}

	public CustomerContract(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setCustId(java.lang.Integer value) {
		this.custId = value;
	}
	
	public java.lang.Integer getCustId() {
		return this.custId;
	}
	public void setContractStyle(java.lang.String value) {
		this.contractStyle = value;
	}
	
	public java.lang.String getContractStyle() {
		return this.contractStyle;
	}
	public void setContractType(java.lang.Integer value) {
		this.contractType = value;
	}
	
	public java.lang.Integer getContractType() {
		return this.contractType;
	}
	public void setLang(java.lang.String value) {
		this.lang = value;
	}
	
	public java.lang.String getLang() {
		return this.lang;
	}
	
	

	public String getBeginDString() {
		return DateConvertUtils.format(getBeginD(), FORMAT_BEGIN_D);
	}
	public void setBeginDString(String value) {
		setBeginD(DateConvertUtils.parse(value, FORMAT_BEGIN_D,java.util.Date.class));
	}
	
	public void setBeginD(java.util.Date value) {
		this.beginD = value;
	}
	
	public java.util.Date getBeginD() {
		return this.beginD;
	}
	public String getEndDString() {
		return DateConvertUtils.format(getEndD(), FORMAT_END_D);
	}
	public void setEndDString(String value) {
		setEndD(DateConvertUtils.parse(value, FORMAT_END_D,java.util.Date.class));
	}
	
	public void setEndD(java.util.Date value) {
		this.endD = value;
	}
	
	public java.util.Date getEndD() {
		return this.endD;
	}
/*	public String getArDString() {
		return DateConvertUtils.format(getArD(), FORMAT_AR_D);
	}
	public void setArDString(String value) {
		setArD(DateConvertUtils.parse(value, FORMAT_AR_D,java.util.Date.class));
	}
	*/
	public void setArD(Integer value) {
		this.arD = value;
	}
	
	public Integer getArD() {
		return this.arD;
	}

	public String getPreArDString() {
		return DateConvertUtils.format(getPreArD(), FORMAT_PRE_AR_D);
	}
	public void setPreArDString(String value) {
		setPreArD(DateConvertUtils.parse(value, FORMAT_PRE_AR_D,java.util.Date.class));
	}
	
	public void setPreArD(java.util.Date value) {
		this.preArD = value;
	}
	
	public java.util.Date getPreArD() {
		return this.preArD;
	}
	public void setPreUnit(java.lang.String value) {
		this.preUnit = value;
	}
	
	public java.lang.String getPreUnit() {
		return this.preUnit;
	}
	public void setTrialMonths(String value) {
		this.trialMonths = value;
	}
	
	public String getTrialMonths() {
		return this.trialMonths;
	}

	public void setDelayRate(java.lang.Double value) {
		this.delayRate = value;
	}
	
	public java.lang.Double getDelayRate() {
		return this.delayRate;
	}
	public void setSearchLimit(java.lang.String value) {
		this.searchLimit = value;
	}
	
	public java.lang.String getSearchLimit() {
		return this.searchLimit;
	}
	public void setComment(java.lang.String value) {
		this.comment = value;
	}
	
	public java.lang.String getComment() {
		return this.comment;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CustId",getCustId())
			.append("ContractStyle",getContractStyle())
			.append("ContractType",getContractType())
			.append("Lang",getLang())
			.append("ArRate",getArRate())
			.append("MinAr",getMinAr())
			.append("BeginD",getBeginD())
			.append("EndD",getEndD())
			.append("ArD",getArD())
			.append("PreAr",getPreAr())
			.append("PreArD",getPreArD())
			.append("PreUnit",getPreUnit())
			.append("TrialMonths",getTrialMonths())
			.append("RefundRate",getRefundRate())
			.append("DelayRate",getDelayRate())
			.append("SearchLimit",getSearchLimit())
			.append("Comment",getComment())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public String getArRate() {
		return arRate;
	}

	public void setArRate(String arRate) {
		this.arRate = arRate;
	}

	public java.lang.Double getMinAr() {
		return minAr;
	}

	public void setMinAr(java.lang.Double minAr) {
		this.minAr = minAr;
	}

	public java.lang.Double getPreAr() {
		return preAr;
	}

	public void setPreAr(java.lang.Double preAr) {
		this.preAr = preAr;
	}

	public java.lang.Double getRefundRate() {
		return refundRate;
	}

	public void setRefundRate(java.lang.Double refundRate) {
		this.refundRate = refundRate;
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CustomerContract == false) return false;
		if(this == obj) return true;
		CustomerContract other = (CustomerContract)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

